package com.qyhl.module_practice.volunteer.sign.search.item;

import android.content.Context;

import com.qyhl.module_practice.R;
import com.qyhl.module_practice.volunteer.sign.search.PracticeOrigationSearchActivity;
import com.zhy.adapter.recyclerview.base.ItemViewDelegate;
import com.zhy.adapter.recyclerview.base.ViewHolder;

public class ItemPracticeSeacrhOrg implements ItemViewDelegate<PracticeOrigationSearchActivity.SearchIndexBean> {
    private Context context;

    public ItemPracticeSeacrhOrg(Context context) {
        this.context = context;
    }

    @Override
    public int getItemViewLayoutId() {
        return R.layout.practice_item_search_org;
    }

    @Override
    public boolean isForViewType(PracticeOrigationSearchActivity.SearchIndexBean item, int position) {
        return item.getType() == 1;
    }

    @Override
    public void convert(ViewHolder holder, PracticeOrigationSearchActivity.SearchIndexBean searchIndexBean, int position) {
          holder.setText(R.id.title,searchIndexBean.getBean().getName());

          if(searchIndexBean.getBean().isChecked()){
              holder.setImageResource(R.id.org_select,R.drawable.practice_search_org_on);
          }else{
              holder.setImageResource(R.id.org_select,R.drawable.practice_search_org_off);
          }
    }
}
